package com.iims.market.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iims.common.annotation.Excel;
import com.iims.common.core.domain.BaseEntity;
import com.iims.common.core.domain.BussinessEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;

/**
 * @TableName cmis_order
 */
@TableName(value = "cmis_order")
@Data
@ApiModel("订单对象")
@BussinessEntity
public class CmisOrder extends BaseEntity {
    /**
     *
     */
    @ApiModelProperty(value = "订单Id")
    @TableId(type = IdType.INPUT)
    private Long orderId;

    /**
     * 合同Id
     */
    @ApiModelProperty(value = "合同Id", required = true)
    private Long contractId;

    /**
     * 订单编号 自动生成
     */
    @ApiModelProperty(value = "订单编号|自动生成,无法修改")
    private String orderCode;

    /**
     * 订单状态
     */
    @ApiModelProperty(value = "订单状态,值来源于字典business_order_status")
    private Integer orderStatus;

    /**
     * 收货人
     */
    @ApiModelProperty(value = "收货人user_code/长度不能超过60个字符", required = true)
    @Size(min = 0, max = 60, message = "收货人长度不能超过60个字符")
    private String contactor;

    /**
     * 收货地址
     */
    @ApiModelProperty(value = "收货地址/长度不超过500字符", required = true)
    @Size(min = 0, max = 500, message = "收货地址长度不超过500字符")
    @Excel(name = "收货地址")
    private String address;

    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话/长度不能超过15个字符", required = true)
    @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
    @Excel(name = "联系电话")
    private String phoneNum;

    /**
     * 业务类别
     */
    @ApiModelProperty(value = "业务类别,值来源于字典business_common_businessType", required = true)
    private Integer businessType;

    /**
     * 产品频段
     */
    @ApiModelProperty(value = "产品频段,值来源于business_common_productBandType",required = true)
    @Positive(message = "产品频段必须有效")
    private Integer productBandType;

    @ApiModelProperty("产品Id")
    @Positive(message = "产品Id必须有效>0")
    private Long productId;

    @ApiModelProperty("产品数量")
    @Positive(message = "产品数量必须有效>0")
    private Integer count;
}